3.147 \(\int \frac{\tan ^2(a+i \log (x))}{x} \, dx\)

Optimal. Leaf size=18 \[ -\log (x)-i \tan (a+i \log (x)) \]

[Out]

-Log[x] - I*Tan[a + I*Log[x]]

________________________________________________________________________________________

Rubi [A]  time = 0.0249887, antiderivative size = 18, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.133, Rules used = {3473, 8} \[ -\log (x)-i \tan (a+i \log (x)) \]

Antiderivative was successfully verified.

[In]

Int[Tan[a + I*Log[x]]^2/x,x]

[Out]

-Log[x] - I*Tan[a + I*Log[x]]

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \frac{\tan ^2(a+i \log (x))}{x} \, dx &=\operatorname{Subst}\left (\int \tan ^2(a+i x) \, dx,x,\log (x)\right )\\ &=-i \tan (a+i \log (x))-\operatorname{Subst}(\int 1 \, dx,x,\log (x))\\ &=-\log (x)-i \tan (a+i \log (x))\\ \end{align*}

Mathematica [A]  time = 0.0385149, size = 28, normalized size = 1.56 \[ i \tan ^{-1}(\tan (a+i \log (x)))-i \tan (a+i \log (x)) \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[a + I*Log[x]]^2/x,x]

[Out]

I*ArcTan[Tan[a + I*Log[x]]] - I*Tan[a + I*Log[x]]

________________________________________________________________________________________

Maple [A]  time = 0.014, size = 23, normalized size = 1.3 \begin{align*} -i\tan \left ( a+i\ln \left ( x \right ) \right ) +i \left ( a+i\ln \left ( x \right ) \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(a+I*ln(x))^2/x,x)

[Out]

-I*tan(a+I*ln(x))+I*(a+I*ln(x))

________________________________________________________________________________________

Maxima [A]  time = 1.50866, size = 23, normalized size = 1.28 \begin{align*} i \, a - \log \left (x\right ) - i \, \tan \left (a + i \, \log \left (x\right )\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(a+I*log(x))^2/x,x, algorithm="maxima")

[Out]

I*a - log(x) - I*tan(a + I*log(x))

________________________________________________________________________________________

Fricas [B]  time = 0.463124, size = 97, normalized size = 5.39 \begin{align*} -\frac{e^{\left (2 i \, a - 2 \, \log \left (x\right )\right )} \log \left (x\right ) + \log \left (x\right ) - 2}{e^{\left (2 i \, a - 2 \, \log \left (x\right )\right )} + 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(a+I*log(x))^2/x,x, algorithm="fricas")

[Out]

-(e^(2*I*a - 2*log(x))*log(x) + log(x) - 2)/(e^(2*I*a - 2*log(x)) + 1)

________________________________________________________________________________________

Sympy [A]  time = 0.529706, size = 22, normalized size = 1.22 \begin{align*} - \log{\left (x \right )} - \frac{2 e^{2 i a}}{x^{2} + e^{2 i a}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(a+I*ln(x))**2/x,x)

[Out]

-log(x) - 2*exp(2*I*a)/(x**2 + exp(2*I*a))

________________________________________________________________________________________

Giac [B]  time = 1.16253, size = 130, normalized size = 7.22 \begin{align*} -\frac{\frac{2 \, e^{\left (2 i \, a\right )} \log \left (x\right )}{x^{2}} - \frac{e^{\left (2 i \, a\right )} \log \left (\frac{e^{\left (2 i \, a\right )}}{x^{2}} + 1\right )}{x^{2}} + \frac{e^{\left (2 i \, a\right )} \log \left (-\frac{e^{\left (2 i \, a\right )}}{x^{2}} - 1\right )}{x^{2}} + 2 \, \log \left (x\right ) - \log \left (\frac{e^{\left (2 i \, a\right )}}{x^{2}} + 1\right ) + \log \left (-\frac{e^{\left (2 i \, a\right )}}{x^{2}} - 1\right ) - 4}{2 \,{\left (\frac{e^{\left (2 i \, a\right )}}{x^{2}} + 1\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(a+I*log(x))^2/x,x, algorithm="giac")

[Out]

-1/2*(2*e^(2*I*a)*log(x)/x^2 - e^(2*I*a)*log(e^(2*I*a)/x^2 + 1)/x^2 + e^(2*I*a)*log(-e^(2*I*a)/x^2 - 1)/x^2 +
2*log(x) - log(e^(2*I*a)/x^2 + 1) + log(-e^(2*I*a)/x^2 - 1) - 4)/(e^(2*I*a)/x^2 + 1)